import React, { Component } from 'react'

export default class List extends Component {
  jump = () => {
    // 跳转到首页 useHistory() => history 不能用!!!
    console.log(this.props)
    // 类组件中获取history 直接听过this.props
    this.props.history.push('/')
  }
  render() {
    return (
      <div>
        List 我是列表页
        <button onClick={this.jump}>跳转首页</button>
      </div>
    )
  }
}
